package com.shy.configs.converts;

import com.shy.configs.common.enums.PublicStatus;
import org.mapstruct.Named;
import org.springframework.stereotype.Component;

@Component
public class ConvertHelper {

    //处理status
    @Named("transStatus")
    public  String transStatus(String status){
        if( status == null || status.isEmpty()){
            return "未知";
        }

        PublicStatus publicStatus = PublicStatus.valueOf(status);
        return publicStatus.getMsg();
    }
    @Named("transAutoSett")
    public  String transAutoSett(String autoSett){
        if("YES".equals(autoSett) ){
            return "是";
        }else {
            return "否";
        }
    }
}